Conversation
e6c2e22 to
2ea75e7
Compare
| def pytest_runtest_logreport(self, report): | ||
| """pytest_runtest_logreport hook callback""" | ||
| if report.when != 'call': | ||
| if report.when != 'teardown': |
There was a problem hiding this comment.
Defer the execution colection after the test teardown to allow adding execution_tag during the call hook.
There was a problem hiding this comment.
I don't quite understand this bit. I thought logreport is always after the teardown hook? What does this if condition do?
2ea75e7 to
234266e
Compare
| def tag_execution(self, key, val) -> 'TestData': | ||
| """Set tag to test execution""" | ||
| self.tags[key] = val |
There was a problem hiding this comment.
not a blocker, I wonder what will happen if user put non-string key value here.
There was a problem hiding this comment.
Ah! I wasn't aware that tag only support string. I'll handle non-string scenario.
| def pytest_runtest_logreport(self, report): | ||
| """pytest_runtest_logreport hook callback""" | ||
| if report.when != 'call': | ||
| if report.when != 'teardown': |
There was a problem hiding this comment.
I don't quite understand this bit. I thought logreport is always after the teardown hook? What does this if condition do?
The logreport hook is called after |
|
@nprizal please give me a sec, I will have another read at this. |
Taking another look, gaining more pytest understanding
zhming0
left a comment
There was a problem hiding this comment.
I understand it fully now. Let's 🚀 .
I don't think we need an abstraction on top of the marker just yet.
|
I pushed changes to validate the type of |
Add execution level tagging using
execution_tagcustom marker. The test collector will send all tags marked on each test to Buildkite Test Engine. See pytest's custom markers documentation.tagging individual tests using decorator:
tagging all tests in a test class using decorator:
tagging all tests in a module using
pytestmarkhelpertagging tests from a hook: